//
//  YoungHisController.m
//  youthNote
//
//  Created by huangrensheng on 15/12/29.
//  Copyright © 2015年 laber. All rights reserved.
//

#import "YoungHisController.h"
#import "YoungHisCell.h"
#import "YoungHisCommentController.h"
#import "HDBageButton.h"

@interface YoungHisController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation YoungHisController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.view.backgroundColor = [UIColor redColor];
    
    [self createWithLeftStyle:nil middleStyle:@{@"type":@"title",@"title":@"社区"} rightStyle:nil];
    
    // Do any additional setup after loading the view.
}

#pragma mark UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 309;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *identifer = @"YoungHisCell";
    YoungHisCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer];
    if (!cell) {
        cell = [[YoungHisCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer];
    }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    YoungHisCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    
    YoungHisCommentController *comment = [[YoungHisCommentController alloc] init];
    comment.contentHeight = cell.frame.size.height;
    [self.navigationController pushViewController:comment animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
